cmake_minimum_required(VERSION 3.6)

set(CMAKE_CXX_STANDARD 14)
#设置 安装路径
set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}" CACHE PATH "Installation directory" FORCE)
message(STATUS "CMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}")
project(winServer)
add_executable(winServer main.cpp)
add_executable(closeServerErrorWindows closeMain.cpp)
add_executable(TestErroeServer TestErrorServer.cpp)
file(COPY ${CMAKE_SOURCE_DIR}/test/autoTest.vbs DESTINATION ${CMAKE_SOURCE_DIR}/${CMAKE_SYSTEM_NAME}.out FOLLOW_SYMLINK_CHAIN)
file(COPY ${CMAKE_SOURCE_DIR}/test/runCloseServer.bat DESTINATION ${CMAKE_SOURCE_DIR}/${CMAKE_SYSTEM_NAME}.out FOLLOW_SYMLINK_CHAIN)
file(COPY ${CMAKE_SOURCE_DIR}/test/runTestErrorServer.bat DESTINATION ${CMAKE_SOURCE_DIR}/${CMAKE_SYSTEM_NAME}.out FOLLOW_SYMLINK_CHAIN)
file(COPY ${CMAKE_SOURCE_DIR}/test/runServer.bat DESTINATION ${CMAKE_SOURCE_DIR}/${CMAKE_SYSTEM_NAME}.out FOLLOW_SYMLINK_CHAIN)
  
install(TARGETS ${PROJECT_NAME} closeServerErrorWindows TestErroeServer
ARCHIVE DESTINATION ${CMAKE_SOURCE_DIR}/${CMAKE_SYSTEM_NAME}.out
RUNTIME DESTINATION ${CMAKE_SOURCE_DIR}/${CMAKE_SYSTEM_NAME}.out
)

 